from django.db import models


# Create your models here.
class Book(models.Model):
    """
    书籍的表
    """
    title = models.CharField(max_length=100)
    pub_date = models.DateTimeField('date published')

    def __str__(self):
        return self.title


class HeroInfo(models.Model):
    name = models.CharField(max_length=100)
    gender = models.CharField(max_length=100)
    content = models.TextField()
    Book = models.ForeignKey('Book', on_delete=models.CASCADE)
    
    def __str__(self):
        return self.name


class Student(models.Model):
    name = models.CharField(max_length=100)
    gender = models.CharField(max_length=100)
    address = models.CharField(max_length=100)
    sign = models.CharField(max_length=100)
    image = models.CharField(max_length=100)
    password = models.CharField(max_length=100)

    def __str__(self):
        return str(self.id)